<template>
  <a-card title="用户列表">
    <TableOperator :columnTable="columnTable" :tableData="tableList" />
  </a-card>
</template>
<script setup>
import { getUserManageList } from '@/apis/user-manage'
import { reactive } from 'vue'
import TableOperator from '@/components/TableOperator'
const searchOptinos = reactive({
  page: 1,
  size: 2
})

// 获取列表数据
const tableList = reactive({
  list: [],
  total: 0
})
const getUserList = async () => {
  try {
    const result = await getUserManageList(searchOptinos)
    tableList.list = result.data.list
    tableList.total = result.data.total
  } catch (err) {}
}
getUserList()
// 列表头
const columnTable = [
  {
    title: '姓名',
    dataIndex: 'username',
    key: 'username'
  },
  {
    title: '手机号',
    dataIndex: 'mobile',
    key: 'mobile'
  },
  {
    title: '头像',
    dataIndex: 'avatar',
    key: 'avatar',
    align: 'center'
  },
  {
    title: '角色',
    dataIndex: 'role',
    key: 'role'
  },
  {
    title: '开通时间',
    dataIndex: 'openTime',
    key: 'openTime'
  },
  { title: '操作', key: 'operate', dataIndex: 'operate' }
]
</script>

<style scoped lang="scss"></style>
